package com.ybwh.springboot1.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.ybwh.springboot1.conf.intercepter.login.LoginRequired;

@Controller
@RequestMapping("/")
public class IndexController {
	/**
	 * 登录页面
	 * 
	 * @return
	 */
	@RequestMapping("/login")
	public ModelAndView p_login() {

		ModelAndView mv = new ModelAndView("login");
		return mv;

	}

	/**
	 * 登录后的首页
	 * 
	 * @return
	 */
	@LoginRequired
	@RequestMapping("/index")
	public ModelAndView p_index() {
		ModelAndView mv = new ModelAndView("index");
		return mv;

	}

	/**
	 * 404页面
	 * 
	 * @return
	 */
	@RequestMapping("/404")
	@ResponseBody
	public ModelAndView p_404() {
		ModelAndView mv = new ModelAndView("404");
		mv.addObject("exceptionMsg", "");
		return mv;

	}

	/**
	 * 500页面
	 * 
	 * 
	 * @return
	 */
	@RequestMapping("/500")
	@ResponseBody
	public ModelAndView p_500() {
		ModelAndView mv = new ModelAndView("500");
		return mv;

	}

	/**
	 * 空白页面
	 * 
	 * @return
	 */
	@RequestMapping("/blank")
	public ModelAndView p_blank() {

		ModelAndView mv = new ModelAndView("blank");
		return mv;

	}

}
